import api from "./index";

/** 团详情(szc)
 * @param {Object} param
 * @param {number} param.activity_id 团ID
 * @param {string} [param.invite_id] 新团名
 */
export const groupDetail = param => api.get("/api/dkGroup/detail", param);

/** 修改团队名称(zjx)
 * @param {Object} param
 * @param {number} param.id 团ID
 * @param {string} param.group_name 新团名
 */
export const editGroupName = param =>
  api.post("/api/dkGroup/groupRename", param);

/** 解散团(zjx)
 * @param {Object} param
 * @param {number} param.id 团ID
 */
export const breakGroup = param =>
  api.post("/api/dkGroup/dissolveGroup", param);

/** 移出团员(zjx)
 * @param {Object} param
 * @param {number} param.id 团ID
 * @param {number} param.student_id 学生ID
 */
export const expelMember = param =>
  api.post("/api/dkGroup/removeGroupMember", param);

/** 退出团(zjx)
 * @param {Object} param
 * @param {number} param.id 团ID
 */
export const exitGroup = param => api.post("/api/dkGroup/exitGroup", param);

/** 加入团(zjx)
 * @param {Object} param
 * @param {number} param.id 团ID
 * @param {number} [param.invite_user_id] 邀请人ID
 */
export const joinGroup = param => api.post("/api/dkGroup/joinGroup", param);

/** 开团(zjx)
 * @param {Object} param
 * @param {number} param.activity_id 活动ID
 */
export const createGroup = param => api.post("/api/dkGroup/createGroup", param);

/** 组团说明  */
export const explain = param => api.get("/api/dkGroup/explain", param);

/** 分享海报
 * @param {Object} params
 * @param {string} params.id 活动ID
 */
export const sharePoster = param =>
  api.get("/api/dkActivity/sharePoster", param);
